﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;
using System.Web.UI.WebControls.WebParts;

namespace KPIS.GERP.Models.SYS
{
    [Table("sys_scheduler_report")]
    public class SchedulerReport
    {
        public SchedulerReport()
        {
            //SchedulerReportCmds = new HashSet<SchedulerReportCmdDtl>();
            StartWhen = DateTime.Now;
        }

        [Key, DataMember, DatabaseGenerated(DatabaseGeneratedOption.Identity), Column("sch_rep_seq")]
        public virtual int SchRepId { get; set; }

        [DataMember, Column("log_message")]
        public virtual string LogMessage { get; set; }

        [DataMember, Column("amount_command_to_execute")]
        public virtual int? AmountCommandToExecute { get; set; }

        [DataMember, Column("cmd_dtl_seq_execute_error")]
        public virtual int? CmdDtlIdExecuteError { get; set; }

        [DataMember, Column("error_when")]
        public virtual DateTime? ErrorWhen { get; set; }

        [DataMember, Column("start_when")]
        public virtual DateTime StartWhen { get; set; }

        [DataMember, Column("stop_when")]
        public virtual DateTime StopWhen { get; set; }

        [DataMember, Column("execute_completed")]
        public virtual bool ExecuteCompleted { get; set; }

        [DataMember]
        public virtual ICollection<SchedulerReportCmdDtl> SchedulerReportCmds { get; set; }
    }
}